﻿CREATE TABLE [registration].[RegistrationOwner] (
    [RegistrationOwnerID] INT          IDENTITY (1, 1) NOT NULL,
    [RegistrationID]      INT          NULL,
    [EntityID]            INT          NULL,
    [PrimaryOwner]        BIT          NULL,
    [CreatedBy]           VARCHAR (50) NULL,
    [CreatedDate]         DATETIME     NULL,
    [UpdatedBy]           VARCHAR (50) NULL,
    [UpdatedDate]         DATETIME     NULL,
    [EndDate]             DATETIME     NULL,
    CONSTRAINT [PK_RegistrationOwner] PRIMARY KEY CLUSTERED ([RegistrationOwnerID] ASC),
    CONSTRAINT [FK_RegistrationOwner_Entity] FOREIGN KEY ([EntityID]) REFERENCES [entity].[Entity] ([EntityID]),
    CONSTRAINT [FK_RegistrationOwner_Registration] FOREIGN KEY ([RegistrationID]) REFERENCES [registration].[Registration] ([RegistrationID])
);

